package com.example.springbootdemo.config;

import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Slf4j
@Configuration
public class Config01 {

  @Autowired
  public void setApplicationContext(ApplicationContext applicationContext){
    log.info("注入 applicationContext");
  }

  @PostConstruct
  public void init(){
    log.info("初始化");
  }

  @Bean
  public BeanFactoryPostProcessor processor01(){
    return beanFactory -> log.info("执行 processor");
  }
}
